21. Cloning and Exploring The Repo

Cloning and Exploring The Repo

Question:

Start Quiz:

Solution:

INSTRUCTOR NOTE:

Cloning a Repository

To clone a repository, run git clone followed by a space and the repository URL.

Asteroids URL

Use the following url to clone the Asteroids repository: https://github.com/udacity/asteroids.git

Exiting git log

To stop viewing git log output, press q (which stands for quit).

Getting Colored Output

To get colored diff output, run git config --global color.ui auto

Copying and Pasting from the Command Line

To complete this quiz, you'll want to copy and paste some commit ids.

Windows
To copy and paste within Git Bash, follow the instructions on this page.

Mac
To copy and paste within the terminal on Mac, use Cmd+C and Cmd+V

Ubuntu
To copy and paste within the terminal on Ubuntu, use Ctrl+Shift+C and Ctrl+Shift+V.

Using git log and git diff

As a reminder, running git log will show a list of the recent commits with information about them, including commit IDs. Running git diff followed by two commit IDs will compare the two versions of the code in those commits. If you need a refresher, you may want to rewatch this video.

Entering commit IDs

If it is easier, you may enter the first four or more characters of the commit ID rather than pasting the entire ID.